<script>
    function shit(){
        if($('#brand').val()!='' && $('#model').val()==''){
            alert('请输入型号！！！');
            return false;
        }
        if($('#model').val()!='' && $('#brand').val()==''){
            alert('请输入品牌！！！');
            return false;
        }
    }
</script>

<!--top结束-->
<div class="mian">
    <div class="mian1">
        <div class="mian2">
            <!--left start-->
            <?php $this->load->view('defaults/common/left');?>
            <!--left end-->
            <!--right start-->
            <div class="right">
                <!--breadcrumb start-->
                <div class="righta"><?=$this->breadcrumb->generateHTML();?> </div>
                <!--breadcrumb end-->
                <!-- contents start -->
                <div id="contents">
                    <div id="contents_container">
                        <form action="<?=blang_url('orders/Smtexcel/addbrandmodel/'.$query[0]['parent_order_id'])?>" method="post" name="productform" onsubmit="return myform_submit()" autocomplete="off" >
                            <table cellpadding="0" cellspacing="0" id="table_forms" border="1">
                                <tr>
                                    <td>商品名：<input type="text" name="names" value="<?=htmlentities($query[0]['item_name'])?>" size="120"></td>
                                </tr>
                                <tr>
                                    <td>品牌：<input type="text" id="brand" name="brand" value="<?=$brand?>">
                                        <?php if($brand){?>已存在型号：
                                            <?php foreach($models as $row):?>
                                                <?=$row['model']?><span style="color: red">|</span>
                                            <?php endforeach?>
                                        <?php }?>
                                    </td>
                                </tr>
                                <tr>
                                    <td>型号：<input type="text" id="model" name="model" value=""></td>
                                </tr>
                                <tr>
                                    <td><input type="submit" value="提交" onclick="return shit()"></td>
                                </tr>
                            </table>
                        </form>
                    </div>
                </div>
                <!-- contents end -->
            </div>
            <!--right end-->
        </div>
    </div>
</div>